package com.buddy.design.pattern._10observer.advice;

import java.util.Observable;
import java.util.Observer;

public class Teacher implements Observer {

    private String name;

    public Teacher(String name) {
        this.name = name;
    }

    @Override
    public void update(Observable observable, Object arg) {
        Gper gper = (Gper)observable;
        Question question = (Question) arg;
        System.out.println(this.name+"老师，在"+gper.getName()+"收到了一个问题");
        System.out.println(question.getUserName()+":"+question.getContent());
    }
}
